package com.woody.aggregate.domain.msgsendrule;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.woody.aggregate.infrastructure.msgsendrule.entity.MsgSendRuleTargetRef;
import com.woody.aggregate.infrastructure.msgsendrule.mapper.MsgSendRuleTargetRefMapper;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * &copy; All rights Reserved
 *
 * @author wénkǎi.zhāng 2025-03-21
 */
@Component
public class MsgSendRuleTargetRefManager extends ServiceImpl<MsgSendRuleTargetRefMapper, MsgSendRuleTargetRef> {
    /**
     * 分页查询规则绑定的用户列表
     * <br />
     * @param page
     * @param ruleId
     * @return
     */
    public Page<MsgSendRuleTargetRef> pageQueryTargets(Page page, Integer ruleId) {
        return getBaseMapper().pageQueryTargets(page, ruleId);
    }

    /**
     * 过滤并返回规则已绑定的用户列表
     * <br />
     * @param ruleId
     * @param targetType
     * @param bizIds
     * @return
     */
    public List<Long> getBoundTargets(Integer ruleId, Integer targetType, List<Long> bizIds) {
        return getBaseMapper().getBoundTargets(ruleId, targetType, bizIds);
    }
}
